/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package rps;

import enums.RPSenum;
import java.util.ArrayList;
import java.util.Random;

/**
 *
 * @author Gautier
 */
public class Player {

    String name;
    int score;
    ArrayList<RPSenum> list;
    
    public RPSenum getNextMove(){
        RPSenum e = this.list.get(0);
        this.list.remove(0);
        return e;
    }
    
    public Player(String name) {
        this.name = name;
        this.score = 0;
        list = new ArrayList();
        Random r = new Random();
        for (int i = 0; i < 10; i++) {
            int rand = r.nextInt();
            if (rand % 3 == 0) {
                list.add(RPSenum.ROCK);
            }
            if (rand % 3 == 1) {
                list.add(RPSenum.PAPER);
            }
            if (rand % 3 == 2) {
                list.add(RPSenum.SCISSORS);
            }
        }
    }

    public Player(String name, ArrayList<RPSenum> list) {
        this.name = name;
        this.list = list;
        this.score = 0;
    }
        public Player(String name, RPSenum e) {
        this.name = name;
        this.list = new ArrayList<RPSenum>();
        this.score = 0;
        if (RPSenum.ROCK == e) {
        for (int i = 0; i < 10; i++) {
            list.add(RPSenum.ROCK);
        }
        }
        else if (RPSenum.PAPER == e) {
        for (int i = 0; i < 10; i++) {
            list.add(RPSenum.PAPER);
        }
        }
        else {for (int i = 0; i < 10; i++) {
            list.add(RPSenum.SCISSORS);
        }}
        }

    public String getName() {
        return name;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }
    
    
}
